# Metview Macro

#  **************************** LICENSE START ***********************************
# 
#  Copyright 2015 ECMWF. This software is distributed under the terms
#  of the Apache License version 2.0. In applying this license, ECMWF does not
#  waive the privileges and immunities granted to it by virtue of its status as
#  an Intergovernmental Organization or submit itself to any jurisdiction.
# 
#  ***************************** LICENSE END ************************************

amsua = read("/home/graphics/cgi/metview//course_prep/2015/day_3/data 2/AMSUA.odb")


odb_filter = odb_filter(
    odb_query : "select " &
                    "  lat@hdr as lat, " &
                    "  lon@hdr as lon, " &
                    "  fg_depar@body as fg_dep, " &
                    "  an_depar@body as an_dep " &
                    "where " &
                    "  vertco_reference_1@body = 5 ",
    odb_data  : amsua
    )


lats = values(odb_filter, 'lat')
lons = values(odb_filter, 'lon')
vals = values(odb_filter, 'fg_dep')

num_vals = count(vals)

geo = create_geo(num_vals, 'xyv')
geo = set_latitudes (geo, lats)
geo = set_longitudes(geo, lons)
geo = set_values    (geo, vals)
return geo



